bitkeeper revision 1.1159.205.1 (41c1b63cODLXVNkV2OsvJtzvIRxtKg)
authorcl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Thu, 16 Dec 2004 16:22:20 +0000 (16:22 +0000)
committercl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Thu, 16 Dec 2004 16:22:20 +0000 (16:22 +0000)
Remove VIRQ_MISDIRECT altogether.

xen/common/event_channel.c
xen/include/public/xen.h
xen/include/xen/sched.h

index bf5170c683c14b4cce961e57d97e1b5838186266..bc9a92052d8a154741c5adc75053c22cff835bd6 100644 (file)
@@ -256,11 +256,9 @@ static long evtchn_bind_virq(evtchn_bind_virq_t *bind)
 
     /*
      * Port 0 is the fallback port for VIRQs that haven't been explicitly
-     * bound yet. The exception is the 'misdirect VIRQ', which is permanently 
-     * bound to port 0.
+     * bound yet.
      */
     if ( ((port = ed->virq_to_evtchn[virq]) != 0) ||
-         (virq == VIRQ_MISDIRECT) ||
          ((port = get_free_port(ed)) < 0) )
         goto out;
 
@@ -353,8 +351,7 @@ static long __evtchn_close(struct domain *d1, int port1)
 
     chn1 = d1->event_channel;
 
-    /* NB. Port 0 is special (VIRQ_MISDIRECT). Never let it be closed. */
-    if ( (port1 <= 0) || (port1 >= d1->max_event_channel) )
+    if ( (port1 < 0) || (port1 >= d1->max_event_channel) )
     {
         rc = -EINVAL;
         goto out;
@@ -363,6 +360,7 @@ static long __evtchn_close(struct domain *d1, int port1)
     switch ( chn1[port1].state )
     {
     case ECS_FREE:
+    case ECS_RESERVED:
         rc = -EINVAL;
         goto out;
 
@@ -541,6 +539,7 @@ static long evtchn_status(evtchn_status_t *status)
     switch ( chn[port].state )
     {
     case ECS_FREE:
+    case ECS_RESERVED:
         status->status = EVTCHNSTAT_closed;
         break;
     case ECS_UNBOUND:
@@ -645,8 +644,7 @@ int init_event_channels(struct domain *d)
     /* Call get_free_port to initialize d->event_channel */
     if ( get_free_port(d->exec_domain[0]) != 0 )
         return -EINVAL;
-    d->event_channel[0].state  = ECS_VIRQ;
-    d->event_channel[0].u.virq = VIRQ_MISDIRECT;
+    d->event_channel[0].state = ECS_RESERVED;
     return 0;
 }
 
index 057b0bd76ea327cd75eb96f9cf76b9622c74d9cf..d963c64313ee00aeb798205ac1d028a7a745111c 100644 (file)
  * 
  * Virtual interrupts that a guest OS may receive from Xen.
  */
-#define VIRQ_MISDIRECT  0  /* Catch-all interrupt for unbound VIRQs.      */
-#define VIRQ_TIMER      1  /* Timebase update, and/or requested timeout.  */
-#define VIRQ_DEBUG      2  /* Request guest to dump debug info.           */
-#define VIRQ_CONSOLE    3  /* (DOM0) bytes received on emergency console. */
-#define VIRQ_DOM_EXC    4  /* (DOM0) Exceptional event for some domain.   */
-#define VIRQ_PARITY_ERR 5  /* (DOM0) NMI parity error.                    */
-#define VIRQ_IO_ERR     6  /* (DOM0) NMI I/O error.                       */
+#define VIRQ_TIMER      0  /* Timebase update, and/or requested timeout.  */
+#define VIRQ_DEBUG      1  /* Request guest to dump debug info.           */
+#define VIRQ_CONSOLE    2  /* (DOM0) bytes received on emergency console. */
+#define VIRQ_DOM_EXC    3  /* (DOM0) Exceptional event for some domain.   */
+#define VIRQ_PARITY_ERR 4  /* (DOM0) NMI parity error.                    */
+#define VIRQ_IO_ERR     5  /* (DOM0) NMI I/O error.                       */
 #define NR_VIRQS        7
 
 /*
index a138c64dda5c4f5ce8770d43b5f8aa6b5f2ae277..355faa43c128a2a65239a0be1764d0166a127442 100644 (file)
@@ -32,11 +32,12 @@ extern struct domain *dom0;
 typedef struct event_channel_st
 {
 #define ECS_FREE         0 /* Channel is available for use.                  */
-#define ECS_UNBOUND      1 /* Channel is waiting to bind to a remote domain. */
-#define ECS_INTERDOMAIN  2 /* Channel is bound to another domain.            */
-#define ECS_PIRQ         3 /* Channel is bound to a physical IRQ line.       */
-#define ECS_VIRQ         4 /* Channel is bound to a virtual IRQ line.        */
-#define ECS_IPI          5 /* Channel is bound to a virtual IPI line.        */
+#define ECS_RESERVED     1 /* Channel is reserved.                           */
+#define ECS_UNBOUND      2 /* Channel is waiting to bind to a remote domain. */
+#define ECS_INTERDOMAIN  3 /* Channel is bound to another domain.            */
+#define ECS_PIRQ         4 /* Channel is bound to a physical IRQ line.       */
+#define ECS_VIRQ         5 /* Channel is bound to a virtual IRQ line.        */
+#define ECS_IPI          6 /* Channel is bound to a virtual IPI line.        */
     u16 state;
     union {
         struct {